package com.lei.chinese_herbal_medicine.Service.Impl;

import com.lei.chinese_herbal_medicine.Entity.PageData;
import com.lei.chinese_herbal_medicine.Entity.TestDataset;
import com.lei.chinese_herbal_medicine.Entity.TrainDataset;
import com.lei.chinese_herbal_medicine.Mapper.TestDatasetMapper;
import com.lei.chinese_herbal_medicine.Service.TestDatasetService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


/**
 * (TestDataset)表服务实现类
 *
 * @author makejava
 * @since 2024-01-18 10:06:42
 */
@Service("testDatasetService")
public class TestDatasetServiceImpl implements TestDatasetService {
    @Resource
    private TestDatasetMapper testDatasetMapper;

    @Override
    public boolean insert(TestDataset testDataset) {
        return testDatasetMapper.insert(testDataset)==1;
    }

    @Override
    public List<TestDataset> selectTestDatasetByHerbId(String herbId, PageData pageData) {
        List<TestDataset> testDatasets = testDatasetMapper.selectTestDatasetByHerbIdWithBLOBs(herbId,pageData);
        pageData.setCount(testDatasetMapper.selectTestDatasetCount(herbId));
        return testDatasets;
    }
    @Override
    public boolean deleteByPrimaryKey(String id) {
        return testDatasetMapper.deleteByPrimaryKey(id)==1;
    }
}


